package ControlLayer;
import ModelLayer.*;

/**
 * Write a description of class CustomerCtr here.
 * 
 * @author (Gruppe 2) 
 * @version (a version number or a date)
 */
public class PersonCtr
{
    private CustomerCon PersonCon;

    public PersonCtr()
    {
        PersonCon = PersonCon.getInstance();
    }

    // Create new customer
    public void createCustomer(int id, String name, String address, String phone, String mail, String CPRnr)
    {
        if(customerCon.getCustomer(id) == null)
        {
            Customer newCustomer = new Customer(id, name, address, phone, mail, CPRnr);
            customerCon.addCustomer(newCustomer);
        }
        else
        {
            System.out.println("There already exists a customer with id: "+id+" in the system");
        }
    }